package com.example.reader.controller;

import com.example.reader.common.Result;
import com.example.reader.entity.Category;
import com.example.reader.service.CategoryService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
public class CategoryController {
    @Resource
    private CategoryService categoryService;

    @GetMapping("/category/selectAll")
    public Result selectAll(Category category){
        List<Category> list = categoryService.selectAll(category);
        return Result.success(list);
    }
}
